package com.pro.service.imple;

import com.pro.mapper.JsUserCouponUsedMapper;
import com.pro.pojo.JsBeforeUser;
import com.pro.pojo.JsUserCouponUsed;
import com.pro.service.JsUserCouponUsedService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class JsUserCouponUsedServiceImple implements JsUserCouponUsedService {
    @Autowired
    JsUserCouponUsedMapper jucum;

    @Override
    public List<JsBeforeUser> getAllJsBeforeUser(String account,String nickname) {
        return jucum.getAllJsBeforeUser(account,nickname);
    }

    @Override
    public Integer getUsedCoupon(JsUserCouponUsed param) {
        return jucum.getUsedCoupon(param);
    }

    @Override
    public boolean addJsUserCouponUsed(JsUserCouponUsed param) {
        boolean b = jucum.updateCouponQuantity(param);
        if (b){
            return jucum.addJsUserCouponUsed(param);
        }
        return false;
    }

    @Override
    public List<JsUserCouponUsed> getAllstate(JsUserCouponUsed param) {
        return jucum.getAllstate(param);
    }

    @Override
    public List<JsUserCouponUsed> getAllstateExpired(JsUserCouponUsed param) {
        return jucum.getAllstateExpired(param);
    }


}
